home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Programming / Programming Languages / XLISP 2.0 / XLISP Tools / Utility (UL) / MSG.LSP < prev    next >
Encoding:
Lisp/Scheme  |  1988-01-09  |  579 b   |  19 lines  |  [TEXT/ttxt]

  1. ; This function prints each its arguments to *standard-output* using the
  2. ; PRINC function except that a T will result in the start of a new line.
  3. ; For example:
  4. ;     (msg 12 " squared is " 144 t)
  5. ; results in:
  6. ;     12 squared is 144
  7. ; It was inspired by an XLISP bug report submitted by Ed Folger.
  8. ;
  9.  
  10. (provide 'msg)
  11.  
  12. (defmacro msg (&rest args) 
  13.   (do ((next args (cdr next))
  14.        (form nil))
  15.       ((null next) `(progn ,@(reverse form)))
  16.     (cond ((eq (car next) t)
  17.            (setq form (cons '(terpri) form)))
  18.           (t (setq form (cons `(princ ,(car next)) form))))))
  19.